const Koa = require('koa');
const views = require('koa-views');
const { resolve } = require('path');
const app = new Koa();

/**
 * 设置 路径 /views 下所有 .pug 文件为模板
 */
app.use(views(resolve(__dirname,'./views'),{
    extension: 'pug'
}))

app.use(async (ctx, next) => {
    await ctx.render('index',{
        xml: 'heihei'
    });
})

app.listen(3000);